package com.suncnpap.library.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.util.database.mybatis.Page;
import com.suncnpap.library.service.ChineseClassificationService;
import com.suncnpap.library.mapper.ChineseClassificationMapper;
import com.suncnpap.library.model.ChineseClassification;
import com.suncnpap.library.model.Library;

/** 
 * 说明： 中图分类Service实现类
 * @version
 */
@Service("chineseClassificationService")
public class ChineseClassificationServiceImpl implements ChineseClassificationService{

	
	@Autowired
	ChineseClassificationMapper chineseClassificationMapper;
	
	@Override
	public void add(ChineseClassification obj) {
		// TODO Auto-generated method stub
		chineseClassificationMapper.add(obj);
	}

	@Override
	public void update(ChineseClassification obj) {
		// TODO Auto-generated method stub
		chineseClassificationMapper.edit(obj);
	}

	@Override
	public void deleteById(String strId) {
		// TODO Auto-generated method stub
		chineseClassificationMapper.deleteById(strId);
		
	}
	@Override
	public void deleteMore(String[] strIds) {
		// TODO Auto-generated method stub
		chineseClassificationMapper.deleteMore(strIds);
	}

	@Override
	public Page list(Page page) {
		// TODO Auto-generated method stub
		List<ChineseClassification> list = chineseClassificationMapper.datalistPage(page);
		page.setDataList(list);
		return page;
	}


	@Override
	public int findCount(Page page) {
		// TODO Auto-generated method stub
		return chineseClassificationMapper.findCount(page);
	}

	@Override
	public ChineseClassification findById(String strId) {
		// TODO Auto-generated method stub
		return chineseClassificationMapper.findById(strId);
	}
	@Override
	public ChineseClassification findByCode(String strCode, String strSchoolId) {
		// TODO Auto-generated method stub
		return chineseClassificationMapper.findByCode(strCode, strSchoolId);
	}
	
	@Override
	public  void addList(List<ChineseClassification> objList){
		if(objList!=null && objList.size()>0){
			for(ChineseClassification chineseClassification:objList){
				if(chineseClassification!=null){
					chineseClassificationMapper.add(chineseClassification);
				}
			}
		}
	}
	
	@Override
	public void deleteBySchoolId(String strSchoolId) {
		// TODO Auto-generated method stub
		chineseClassificationMapper.deleteBySchoolId(strSchoolId);
		
	}
}

